<template>
	<view @click="editClick">
      <image :src="data.img" mode="widthFix"></image>
			<view class="clip mt10 fz14 mt5" :class="showCategory || showRate ? 'c1' : 'c2'" style="color: #222222;">
				{{data.name}}
			</view>
			<view v-if="showCategory" class="fz12 gray mt5">{{data.categoryName}}</view>
			<view v-if="showRate" class="fz12 orange mt5">{{data.score ? data.score : '9.8'}}分</view>
	</view> 
</template>
<script>
	export default {
		name:"uni-books",
		props:{
			flag : {
				type : String ,
				default: "novel"
			},
			data: {
				type : Object ,
				default(){
					return {} ;
				}
			},
			showRate : Boolean,
			showCategory : Boolean
		},
		computed:{
			
		},
     methods: {
      editClick(){
      	this.$emit('flags',this.data)
      } 
    }
	}
</script>
<style>
  .mt5{
    text-align: center;
  }
</style>
